﻿using NUnit.Framework;

namespace Simhopp.Common
{
    /// <summary>
    /// A test class for the Judge class.
    /// </summary>
    [TestFixture]
    public class TestJudge
    {
        #region FIELD REGION
        private User defaultJudge;
        private User judge;
        #endregion
        #region TEST METHOD REGION
        [SetUp]
        public void Init()
        {
            defaultJudge = new User();
            judge = new User
            {
                UserName = "ankan155", 
                Name = "Majvor Gunnarsson", 
                Gender = Genders.Female, 
                Age = 22, 
                Nationality = "USA", 
                SocialSecurityNumber = "19910506",
                AccountType = AccountTypes.Judge,
                HasSubmittedScore = true
            };
        }

        [Test]
        public void TestConstructors()
        {
            Assert.AreEqual("ankan155", judge.UserName);
            Assert.AreEqual("Majvor Gunnarsson", judge.Name);
            Assert.AreEqual(Genders.Female, judge.Gender);
            Assert.AreEqual(22, judge.Age);
            Assert.AreEqual("USA", judge.Nationality);
            Assert.AreEqual("19910506", judge.SocialSecurityNumber);
            Assert.AreEqual(AccountTypes.Judge, judge.AccountType);
            Assert.AreEqual(true, judge.HasSubmittedScore);

            Assert.AreEqual("", defaultJudge.UserName);
            Assert.AreEqual("", defaultJudge.Name);
            Assert.AreEqual(Genders.Male, defaultJudge.Gender);
            Assert.AreEqual(0, defaultJudge.Age);
            Assert.AreEqual("", defaultJudge.Nationality);
            Assert.AreEqual("", defaultJudge.SocialSecurityNumber);
            Assert.AreEqual(AccountTypes.NoAccess, defaultJudge.AccountType);
            Assert.AreEqual(false, defaultJudge.HasSubmittedScore);
        }

        [Test]
        public void TestProperties()
        {
            defaultJudge.UserName = "bävern33";
            defaultJudge.Name = "Klas Klättermus";
            defaultJudge.Gender = Genders.Male;
            defaultJudge.Age = 16;
            defaultJudge.Nationality = "Jamaica";
            defaultJudge.SocialSecurityNumber = "199412117584";
            defaultJudge.AccountType = AccountTypes.Administrator;
            defaultJudge.HasSubmittedScore = true;

            Assert.AreEqual("bävern33", defaultJudge.UserName);
            Assert.AreEqual("Klas Klättermus", defaultJudge.Name);
            Assert.AreEqual(Genders.Male, defaultJudge.Gender);
            Assert.AreEqual(16, defaultJudge.Age);
            Assert.AreEqual("Jamaica", defaultJudge.Nationality);
            Assert.AreEqual("199412117584", defaultJudge.SocialSecurityNumber);
            Assert.AreEqual(AccountTypes.Administrator, defaultJudge.AccountType);
            Assert.AreEqual(true, defaultJudge.HasSubmittedScore);
        }

        [TearDown]
        public void Terminate()
        {

        }
        #endregion
    }
}
